package cate.game.play.skill.active;

import cate.common.table.d.GD;
import cate.game.play.buff.BuffParam;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.SkillActionCtx;

/**
 * 对敌方横排2个单位造成220%法术伤害，55%概率附加[冰冻]，同时为自身附加一个本次伤害30%的[护盾]
 */
public class 星罗棋布AH extends ActiveHandler{

	private double 系数;

	private int buff;

	//系数=3000&buff=？？
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		系数 = args.getWDouble("系数", 0d);
		buff = args.getInt("buff", 0);
	}

	@Override
	public void parseExt(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		系数 += args.getWDouble("系数", 0d);
	}

	@Override
	public void onSkillDone(SkillActionCtx action) {
		double damage = action.getStat().getTotalSkillDamage(skill.owner.getPid());
		if (damage <= 0) {
			return;
		}
		BuffParam param = new BuffParam().buffHpSet(damage * 系数);
		skill.owner.buff.tryAddByTid(action, skill.owner, buff, param);
	}
}
